{include file="common/top" /}
<div style="padding: 20px;background: #ffffff;" >
	<form class="layui-form " action="">
	<div class="layui-form-item">
		<label class="layui-form-label">*账户来源：</label>
		<div class="layui-col-xs4">
			<select name="source"  autocomplete="off">
				<option value="">请选择账户来源</option>
				<option value="1" {eq name="rs.source" value="1"}selected{/eq}>牧唐</option>
				<option value="2" {eq name="rs.source" value="2"}selected{/eq}>糖果</option>
			</select>
		</div>
		<label class="layui-form-label">*账户类别：</label>
		<div class="layui-col-xs4">
			<select name="acc_type"  autocomplete="off">
				<option value="">请选择账户类别</option>
				<option value="1" {eq name="rs.acc_type" value="1"}selected{/eq}>快手</option>
				<option value="2" {eq name="rs.acc_type" value="2"}selected{/eq}>头条</option>
				<option value="3" {eq name="rs.acc_type" value="3"}selected{/eq}>知乎</option>
				<option value="4" {eq name="rs.acc_type" value="4"}selected{/eq}>广点通</option>
				<option value="5" {eq name="rs.acc_type" value="5"}selected{/eq}>百度</option>
			</select>
		</div>
	</div>
	{notempty name="name"}
		<div class="layui-form-item">
			<label class="layui-form-label">上级账户：</label>
			<div class="layui-col-xs4">{$name}
				<input type="hidden" name="pid" value="{$type}"  >
			</div>
		</div>
	{/notempty}
	
	<div class="layui-form-item">
		<label class="layui-form-label">渠道名称：</label>
		<div class="layui-col-xs4">
			<select name="channel_id" lay-verify="required" lay-search=""  lay-verify="required" autocomplete="off">
				<option value="">直接选择或搜索选择</option>
				{volist name="channel_list" id='qd'}
					<option value="{$qd.id}" {eq name="rs.channel_id" value="$qd.id"}selected{/eq}>{$qd.name}</option>
				{/volist}
	        </select>
		</div>
		<label class="layui-form-label">运营名称：</label>
		<div class="layui-col-xs4">
			<select name="operate_id"  lay-search="" autocomplete="off">
				<option value="">直接选择或搜索选择</option>
				{volist name="operate_list" id='op'}
					<option value="{$op.id}" {eq name="rs.operate_id" value="$op.id"}selected{/eq}>{$op.username}</option>
				{/volist}
	        </select>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">账户名称：</label>
		<div class="layui-col-xs4">
			<input type="text" name="name" value="{$rs.name}"  lay-verify="required" autocomplete="off" placeholder="请输入账户名称" class="layui-input">
		</div>
		<label class="layui-form-label">账户ID：</label>
		<div class="layui-col-xs4">
			<input type="text" name="name_id" value="{$rs.name_id}" readonly="readonly" lay-verify="required" autocomplete="off" placeholder="请输入账户ID" class="layui-input">
		</div>
	
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">账户进度：</label>
		<div class="layui-col-xs4">
			<select name="jindu"  autocomplete="off">
				<option value="1" {eq name="rs.jindu" value="1"}selected{/eq}>开户中</option>
				<option value="6" {eq name="rs.jindu" value="6"}selected{/eq}>开户成功</option>
				<option value="2" {eq name="rs.jindu" value="2"}selected{/eq}>过素材</option>
				<option value="3" {eq name="rs.jindu" value="3"}selected{/eq}>过素材（1）</option>
				<option value="4" {eq name="rs.jindu" value="4"}selected{/eq}>过素材（2）</option>
				<option value="5" {eq name="rs.jindu" value="5"}selected{/eq}>备户完成</option>
	        </select>
		</div>
		<label class="layui-form-label">行业：</label>
		<div class="layui-col-xs3">
			<select name="industry_id"  lay-search="" autocomplete="off">
				<option value="">直接选择或搜索选择</option>
				{volist name="industry_list" id='hy'}
					<option value="{$hy.id}" {eq name="rs.industry_id" value="$hy.id"}selected{/eq}>{$hy.name}</option>
				{/volist}
	        </select>
		</div>
		<div class="layui-col-xs1">
			<span class="layui-btn layui-btn-normal add_hy">新增</span>
		</div>
	</div>
	<div class="layui-form-item">
		<!-- <label class="layui-form-label">账户类型：</label>
		<div class="layui-col-xs4">
			<select name="type"  autocomplete="off">
				<option value="1" {eq name="rs.type" value="1"}selected{/eq}>自运营</option>
				<option value="2" {eq name="rs.type" value="2"}selected{/eq}>代运营</option>
				<option value="3" {eq name="rs.type" value="3"}selected{/eq}>代充值</option>
	        </select>
		</div> -->
		<label class="layui-form-label">*账户密码：</label>
		<div class="layui-col-xs4">
			<input type="text" name="password" value="{$rs.password}"  lay-verify="required" autocomplete="off" placeholder="请输入账户密码" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">是否封禁：</label>
		<div class="layui-col-xs4">
			<select name="is_banned"  autocomplete="off">
				<option value="0" {eq name="rs.is_banned" value="0"}selected{/eq}>封禁</option>
				<option value="1" {eq name="rs.is_banned" value="1"}selected{/eq}>正常</option>
	        </select>
		</div>
	</div>
	<!-- <div class="layui-form-item">
		<label class="layui-form-label">总消费：</label>
		<div class="layui-col-xs4">
			<input type="text" name="expend" value="{$rs.expend}" lay-verify="required" autocomplete="off" placeholder="请输入账户总消费" class="layui-input">
		</div>
		<label class="layui-form-label">账户余额：</label>
		<div class="layui-col-xs4">
			<input type="text" name="balance" value="{$rs.balance}" lay-verify="required" autocomplete="off" placeholder="请输入账户余额" class="layui-input">
		</div>
	</div> -->
	<hr />
	<div class="layui-form-item">
		<div class="layui-input-block">
			<input type="hidden" name="id" value="{$rs.id}"  >
			<button class="layui-btn"  lay-submit="" lay-filter="demo1">修改</button>
		</div>
	</div>
	
	</form>
	
</div>
{include file="common/footer" /}
<script>
	layui.use(['form', 'layedit', 'laydate'], function(){
		  var form = layui.form ,layer = layui.layer;
		  
		  //监听提交
		  form.on('submit(demo1)', function(data){
			var articleFrom = data.field;
			layer.load(1, { shade : [ 0.5, '#676a6c' ] });
			$.post("{:url('acc_save')}?t=json",articleFrom,function(data){
				layer.closeAll();
				if (data['code'] == 1) {
					var index1 = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
					parent.layer.close(index1); //再执行关闭 
					//父页面数据 ，重新加载
					parent.get_s(data['msg']);

				} else {
					layer.msg(data['msg'], { icon : 5 });
				}
			});
			
			return false;
		  });
		  $(".add_hy").click(function(){
				layer.prompt({title:'行业名称'},function(value, index, elem){
					layer.load(1, { shade : [ 0.5, '#676a6c' ] }); 
					$.post("{:url('Item/industry_add')}?t=json",{name:value},function(da){
						layer.closeAll();
						if(da['code'] == 1){
							layer.msg(da['msg'], { icon : 6 });
						}else{
						 	layer.msg(da['msg'], { icon : 5 });
						}
					})
				});
			});
		 
		});
	
</script>
